<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue-2.4.0.js"></script>
    <link rel="stylesheet" href="./lib/bootstrap-3.3.7.css">
</head>
<body>
    <div id="app">
        <!-- 分析 -->
        <!-- 1.我们要监听到 文本框数据的改变，才能拼出fullname -->
        <!-- 2.如何坚挺到文本框数据的改变 --使用keyup事件来监听-->
        <input type="text" v-model='firstname' @keyup='getFullname'>+
        <input type="text" v-model='lastname' @keyup='getFullname'>=
        <input type="text" v-model='fullname'>

    </div>
    <script>
        var vm=new Vue({
            el:"#app",
            data:{
                firstname: '',
                lastname: '',
                fullname: '',

            },
            methods: {
                getFullname(){
                    this.fullname=this.firstname + this .lastname 
                },
            },
        })
    </script>
</body>
</html>